import store from '@/store'
export default {
  methods: {
    checkPermission(key) {
      // const { userInfo } = store.state.user.userInfo
      // if (userInfo.roles && userInfo.roles.points && userInfo.roles.points.length) {
      //   return userInfo.roles.points.some(item => item === key)
      // }
      // return false
      //  const { roles } = store.state.user.userInfo.roles
      // return roles ? roles.points.includes(key) : false
      // 可选链写法
      return store.state.user.userInfo.roles?.points.includes(key)
    }
  }
}
